import request from '@/utils/request'

// 公告附件相关接口
export function uploadAttachment(data) {
  return request({
    url: '/announcement-attachments/upload',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function getAttachmentList(announcementId) {
  return request({
    url: `/announcement-attachments/list/${announcementId}`,
    method: 'get'
  })
}

export function deleteAttachment(id) {
  return request({
    url: `/announcement-attachments/${id}`,
    method: 'delete'
  })
}

export function getDownloadUrl(id) {
  return process.env.VUE_APP_BASE_API + `/announcement-attachments/download/${id}`
} 